

<div class="spage-main-box">
    <{if $order}>
        <{if $order.is_has_remote_pdts!=='true'}>
            <{include file="admin/order/order_edit.html"}>
        <{elseif $order.is_has_remote_pdts=='true'}>
        
            <{include file="admin/order/edit_po.html"}> 
            
        <{/if}>   
	<{else}>   
        <{include file="admin/order/detail/detail.html"}> 
    <{/if}>   
</div>

<script language='javascript'>
function picking(product_id){
    showDiv(product_id,function(){
        var inputIds = $$('[name="goodsmadan_ids['+product_id+']"]');
        var inputMi = $$('[name="goodsnum['+product_id+']"]');
        var inputJu = $$('[name="goodsjuanshu['+product_id+']"]');
        var madan_ids=inputIds.get('value');
        var mishu=inputMi.get('value');
        var juanshu=inputJu.get('value');
        var inputs = document.getElementsByTagName('input');//获取所有的input标签对象
        if (madan_ids != '') {
            var arr=madan_ids[0].split(',');//注split可以用字符或字符串分割
            for (var i=0;arr[i];i++){
               $$("[id='chkRoll["+arr[i]+"]']").set('checked','checked');
            }
            //往选中之中填值 
            //合计显示在页面上
            var totalStr="<b>选中:"+"<font color='red'>"+juanshu+"</font>&nbsp;&nbsp;卷&nbsp;&nbsp;共:"+"<font color='red'>"+mishu+"</font>&nbsp;&nbsp;M</b> <div type='hidden' id='total' value='"+mishu+"' cntJuan='"+juanshu+"' madan_ids='"+madan_ids+"'></div> ";
            var spanDiv=window.document.getElementById ("divTotal");
            spanDiv.innerHTML = totalStr;
        }
    });
}
	/*
* 弹出DIV层
*/
//这是个全局变量，为了关闭增加 2015-9-11 by jeff
// var _dialog = null;
function showDiv(product_id,onShow) {
    var dialog = new Dialog('<{link app=b2c ctl=admin_order act=select_bujuan}>', {
        width: 800,
        title: '选择布卷',
        modal: true,
        async: 'ajax',
        //后台跟前台所用的js不一样，后台用的是tools_mins.js参数改为ajaxoptions，onLoad执行异步方法
        onLoad:function() {
        	onShow();
        },
        ajaxoptions: {
            method: 'post',
            data: 'product_id='+product_id
            // onComplete: function() {
            //     dialog.position();
            //     $$('.popup-container')[0].setStyle('z-index', '10001');
            //     $$('.mask')[0].setStyle('z-index', '10000');
            //     onShow();
            // }
        }
    });
    closeDiv = function() {
        dialog.hide();
    }
}
//var closeDiv = function(){};//空函数
</script>